<?php
namespace Home\Controller;
use Think\Controller;
class MenuController extends Controller {
    public function index(){
    	echo "menu";
    }

    public function edit(){
    	
    	$menu_id = $_POST['menu_id'];
    	$menu = D("menu");
    	if(!$menu->create()){
    		$array = array('success'=>0, 'error'=>$menu->getError());
    		exit(json_encode($array));
    	}else{
    		$res = $menu->where("menu_id='%d'", $menu_id)->save();
	        if($res!==false){
                $this->newXml();
	            echo '{"success":1}';
	        }else{
	            echo '{"success":0,"error":"修改失败."}';
	        }
    	}
    }
}